循环枚举Enum
NodeType是枚举的名字
var result = new Dictionary<string, int>();
foreach (var type in System.Enum.GetValues(typeof(NodeType)))
{
result.Add(type.ToString(), (int)type);
}
NodeType是枚举的名字
var result = new Dictionary<string, int>();
foreach (var type in System.Enum.GetValues(typeof(NodeType)))
{
result.Add(type.ToString(), (int)type);
}